/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package canvaswork;

import java.util.ArrayList;

/**
 *
 * @author jonatanhilden
 */

class TextBox {

    private Main main;
    int xpos, ypos;
    int width, height;
    String text;
    ArrayList buttons;
    int displayTimer=140;

    TextBox(Main main, String txt, int x, int y, int w, int h) {
        this.main = main;
        text = txt;
        xpos = x;
        ypos = y;
        width = w;
        height = h;
        main.text(text, xpos, ypos+height);


    }

    void update (String txt){
        displayTimer=140;
        if (displayTimer>0){
                    text= txt;
       // main.text(text, xpos, ypos+height);
        }
        else text= "";
}

    void draw() {
        if (displayTimer>0){
                    main.text(text, xpos, ypos+height);
        displayTimer --;}
        //main.rect(xpos, ypos, width, height);

    }


}

